<h3>
    {$title}
</h3>
<div class="filter">
    <form action="{:U(GROUP_NAME.'/User/index')}" method="post">
        <input name="keyword" type="text" class="inpMain" value="{$keyword}" size="20" />
        <input name="submit" class="btnGray" type="submit" value="筛选" />
    </form>
</div>
<div id="list">
        <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
            <tr>
                <th width="80" align="center">ID</th>
                <th width="150" align="left">用户名</th>
                <th width="80">状态</th>
                <th width="120" align="center">注册日期</th>
                <th align="center">操作</th>
            </tr>
            <volist name="list" id="vo">
                <tr>
                    <td align="center">{$vo.id}</td>
                    <td>{$vo.phone}</td>
                    <td align="center">
                    	<php>
                    		if($vo['status'] == 1) echo "允许登录";
                    		if($vo['status'] == 0) echo "禁止登录";
                    	</php>
                    </td>
                    <td align="center">{$vo.addtime|date='Y-m-d',###}</td>
                    <td align="center">
                    	<php>
                    		if($vo['status'] == 1){
                    			</php>
                    			<a href="{:U(GROUP_NAME.'/User/status',array('id' => $vo['id']))}">禁止登录</a>
                    			<php>
                    		}else{
                    			</php>
                    			<a href="{:U(GROUP_NAME.'/User/status',array('id' => $vo['id']))}">允许登录</a>
                    			<php>
                    		}
                    	</php> |
                    	<a href="{:U(GROUP_NAME.'/User/userinfo',array('user' => $vo['phone']))}">查看资料</a> | 
                        <a href="javascript:changepass('{$vo.id}');">修改密码</a> |
                        <a href="javascript:del('{$vo.phone}','{:U(GROUP_NAME.'/User/del',array('id'=>$vo['id']))}');">删除</a>
                    </td>
                </tr>
            </volist>
        </table>
</div>
<div class="clear"></div>
<div class="pager">
    {$page}
</div>
</div>
<script>
    function del(uname,jumpurl){
        layer.confirm(
                '确定要删除用户:'+uname+'吗?',
                function (){
                    window.location.href = jumpurl;
                }
        );
    }
    function changepass(uid){
		layer.prompt({title: '输入新密码，并确认', formType: 1}, function(pass, index){
			if(pass == '' || pass == null){
				layer.msg('密码不能为空!');
			}else if(pass.length < 6){
				layer.msg("密码长度不能小于6位!");
			}else{
				$.post(
					"{:U(GROUP_NAME.'/User/changepass')}",
					{id:uid,pass:pass},
					function (data,state){
						if(state != "success"){
							layer.msg("网络通讯失败!");
						}else if(data.status == 1){
							layer.msg("密码修改成功!");
							layer.close(index);
						}else{
							layer.msg(data.msg);
						}
					}
				);
			}
		});
    }
</script>